package com.uk.ui.kontrata;

import com.uk.data.containers.KontrataContainer;
import com.uk.ui.ColumnGeneratorUtils;
import com.vaadin.ui.Table;


public class KontrataList extends Table {
	public KontrataList(KontrataPanel kontrataPanel){
		setSizeFull();
		this.setContainerDataSource(kontrataPanel.getDataSource());
		this.setVisibleColumns(KontrataContainer.NATURAL_COL_ORDER);
		this.setColumnHeaders(KontrataContainer.COL_HEADERS_ALBANIAN);
		setColumnCollapsingAllowed(true);
		setColumnReorderingAllowed(true);
		this.setPageLength(15);
		setSelectable(true);
		setImmediate(true);
		addListener((ValueChangeListener) kontrataPanel);
		this.addGeneratedColumn("perdorimi", ColumnGeneratorUtils.perdorimiColumnGenerator());
	
		this.addGeneratedColumn("qarku", ColumnGeneratorUtils.qarkuColumnGenerator());
		this.setColumnHeader("qarku", "Qarku");
		this.addGeneratedColumn("rrethi", ColumnGeneratorUtils.rrethiColumnGenerator());
		this.setColumnHeader("rrethi", "Rrethi");
		this.addGeneratedColumn("bashkiKomuna",ColumnGeneratorUtils.bashkiKomunaColumnGenerator());


		setNullSelectionAllowed(false);
		
		
	}
	
	public KontrataList(KontrataContainer kontrataContainer){
		setSizeFull();
		this.setContainerDataSource(kontrataContainer);
		this.setVisibleColumns(KontrataContainer.NATURAL_COL_ORDER);
		this.setColumnHeaders(KontrataContainer.COL_HEADERS_ALBANIAN);
		setColumnCollapsingAllowed(true);
		setColumnReorderingAllowed(true);
		this.setPageLength(15);
		setSelectable(true);
		setImmediate(true);
		this.addGeneratedColumn("perdorimi", ColumnGeneratorUtils.perdorimiColumnGenerator());
	
		this.addGeneratedColumn("qarku", ColumnGeneratorUtils.qarkuColumnGenerator());
		this.setColumnHeader("qarku", "Qarku");
		this.addGeneratedColumn("rrethi", ColumnGeneratorUtils.rrethiColumnGenerator());
		this.setColumnHeader("rrethi", "Rrethi");
		this.addGeneratedColumn("bashkiKomuna",ColumnGeneratorUtils.bashkiKomunaColumnGenerator());


		setNullSelectionAllowed(false);
	}
	
	
}
